package sis.studentinfo;
import junit.framework.TestCase;

public class StudentTest extends TestCase{
	
public void testBadStatic(){
	Student studentA = new Student("a");
	assertEquals("a", studentA.getName());
	Student studentB = new Student("b");
	assertEquals("b", studentB.getName());
	assertEquals("a", studentA.getName());
}

	public void testCreate(){
		final String firstStudentName = "Jane Doe";
		Student firstStudent = new Student(firstStudentName);
		assertEquals(firstStudentName, firstStudent.getName());
		
		final String secondStudentName = "Joe Blow";
		Student secondStudent = new Student(secondStudentName);
		assertEquals(secondStudentName, secondStudent.getName());
		
	}
	
	public void testFullTime(){
		Student student = new Student("a");
		assertFalse(student.isFullTime());
	}
	
	public void testCredits(){
		Student student = new Student("a");
		assertEquals(0, student.getCredits());
		student.addCredits(3);
		assertEquals(3, student.getCredits());
		student.addCredits(4);
		assertEquals(7, student.getCredits());
	}
	
	public void testStudentStatus(){
		Student student = new Student("a");
		assertEquals(0, student.getCredits());
		assertFalse(student.isFullTime());
		
		student.addCredits(3);
		assertEquals(3, student.getCredits());
		assertFalse(student.isFullTime());
		
		student.addCredits(4);
		assertEquals(7, student.getCredits());
		assertFalse(student.isFullTime());
		
		student.addCredits(5);
		assertEquals(12, student.getCredits());
		assertTrue("enough credits for FT status", student.isFullTime());
	}
	
	public void testInState(){
		Student student = new Student("a");
		assertFalse(student.isInState());
		student.setState(Student.IN_STATE);
		assertTrue(student.isInState());
		student.setState("MD");
		assertFalse(student.isInState());
	}
}
